<template>
  <div class="dw_card">
    <div class="dw_type">
      <span>{{dwInfo.type}}</span>
    </div>
    <div class="dw_title">
      <span>{{dwInfo.name}}</span>
    </div>
    <div class="dw_grid">
      <van-cell-group>
        <van-cell title="法人代表" :value="dwInfo.corporation" />
        <van-cell title="资质证书" :value="dwInfo.certification" />
        <van-cell title="联系电话" :value="dwInfo.telephone" />
        <van-cell title="邮箱" :value="dwInfo.mail" />
      </van-cell-group>
      <van-button
        class="btn_user"
        type="info"
        size="small"
        round
        plain
        hairline
        @click="click_btn(dwInfo.id)"
      >查看从业人员</van-button>
    </div>
  </div>
</template>
<script>
import Vue from "vue";
import { Button, CellGroup, Cell } from "vant";
Vue.use(Button)
  .use(Cell)
  .use(CellGroup);
export default {
  name: "dw_list",
  props: {
    dwInfo: {
      type: Object,
    }
  },
  data() {
    return {
      componentName: "dw_list"
    };
  },
  methods: {
    click_btn(dwid) {
      this.$emit('showUsers', dwid)
    }
  }
};
</script>
<style lang="scss" scoped>
  .dw_card {
    margin: 10px 4px;
    line-height: 28px;
    .dw_type {
      text-align: left;
      span {
        margin-left: 5px;
        font-weight: bold;
        font-size: 0.9rem;
      }
    }
    .dw_title {
      background: linear-gradient(rgb(100, 186, 230), rgb(18, 101, 209));
      color: #fff;
      text-align: center;
      span {
        margin-left: 5px;
        font-size: 0.8rem;
      }
    }
    .dw_grid {
      .van-cell {
        padding: 5px 10px;
        line-height: 1.1rem;
        .van-cell__title {
          text-align: left;
        }
        .van-cell__value {
          flex: 2;
          text-align: left;
        }
      }
      .btn_user {
        width: 150px;
        margin: 5px;
      }
    }
  }
</style>
